package com.yin.waimai.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;

/**
 * 订单通知数据传输对象
 * 用于在系统各模块间传递订单通知信息
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderNotificationDTO {
    private String orderNumber;
    private String itemDescription;
    private Double weight;
    private BigDecimal calculatedFee;
    private AddressDTO shipperInfo;
    private AddressDTO recipientInfo;
    private String creationTime;
    private String status;
    private String message;
    private String type; // "NEW_ORDER", "ORDER_ACCEPTED", etc.
    
    // 邮件通知相关字段
    private String recipientEmail; // 收件人邮箱
    private String shipperEmail; // 寄件人邮箱
    private boolean emailNotificationEnabled; // 是否启用邮件通知
    private String notificationType; // 通知类型：ORDER_CREATED, ORDER_STATUS_UPDATED, DELIVERY_COMPLETED
    
    // 物流轨迹相关字段
    private String location; // 当前位置
    private String operator; // 操作员
    private String description; // 状态描述
    private String orderStatus; // 订单状态（用于邮件模板）
    
    // 便于邮件模板使用的字段
    private String recipientName; // 收件人姓名
    private String shipperName; // 寄件人姓名
    
    /**
     * 构造函数 - 用于创建基本的订单通知
     */
    public OrderNotificationDTO(String orderNumber, String recipientEmail, String orderStatus) {
        this.orderNumber = orderNumber;
        this.recipientEmail = recipientEmail;
        this.orderStatus = orderStatus;
        this.emailNotificationEnabled = true;
    }
    
    /**
     * 构造函数 - 用于创建包含通知类型的订单通知
     */
    public OrderNotificationDTO(String orderNumber, String recipientEmail, String orderStatus, String notificationType) {
        this.orderNumber = orderNumber;
        this.recipientEmail = recipientEmail;
        this.orderStatus = orderStatus;
        this.notificationType = notificationType;
        this.emailNotificationEnabled = true;
    }
}